/*
 * FileSystemInterface.java
 *
 * Created on December 2, 2006, 11:38 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package eu.somatik.somaftp.logic;

import com.glub.secureftp.bean.RemoteFile;
import eu.somatik.somaftp.SomaFTP;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.swing.DefaultListModel;
import javax.swing.ListModel;

/**
 *
 * @author francisdb
 */
public interface FileSystemInterface {
    
    public static final String PROPERTY_HOST = "host";
    public static final String PROPERTY_USER = "user";

    void connect(final DefaultListModel logModel) throws FileSystemException;
    
    boolean isConnected();

    void disconnect();

    void changeDirectory(String path);
    
    String getPath();

    List<FileInterface> list(boolean includeParent);

    void delete(Object...object) throws FileSystemException;
    
    void request(Object object);
    
    void queue(Object object);
    
    void receive(FileTransfer transfer, InputStream is) throws FileSystemException;
    
    void send(FileTransfer transfer, OutputStream os) throws FileSystemException;
    
    void addListener(FileSystemListener listener);
    
    void mkdir(String name);
    
    /**
     * @returns true if this filesystem doesn't need connecting
     */
    boolean isAlwaysConnected();
    
    String getProperty(String key);
    
    void setProperty(String key, String value);
    
    FileInterface getFileObjectFor(String fileName);
    
    Protocol getProtocol();
}
